package model

import (
	"time"
)

type Book struct {
	BaseModel       `xorm:"extends"`
	Name            string    `xorm:"not null comment('书名') VARCHAR(100)" json:"name" validate:"required"`
	Isbn            string    `xorm:"not null comment('ISBN') VARCHAR(50)" json:"isbn" validate:"required"`
	Price           float32   `xorm:"not null comment('单价') " json:"price" validate:"required"`
	Author          string    `xorm:"not null comment('作者') VARCHAR(100)" json:"author" validate:"required"`
	PublishingHouse string    `xorm:"not null comment('出版社') VARCHAR(100)" json:"publishing_house" validate:"required"`
	PublishDate     time.Time `xorm:"not null comment('出版日期') DATE" json:"publish_date" validate:"required"`
	Picture         string    `xorm:"not null comment('图片') VARCHAR(200) " json:"image" validate:"required"`
	Description     string    `xorm:"not null comment('图片') TEXT " json:"description" validate:"required"`
}
